home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-04 | 3.2 KB | 106 lines | [TEXT/MPS ] |
- #
- # File: SimpleSample2.vu
- #
- # Contains: A script that will do some actions with a few control panels,
- # page setup and some other Finder actions.
- #
- # Notes: The settings for the page setup dialog control may need to be
- # adjusted for you specific configuration. Most of the actions
- # performed in this script require System 7. If System 7 is not
- # present, SimpleSample2 will only work with the Page Setup
- # dialog. If the printer driver specified in the PageSetup
- # call differs from the one selected by Chooser, results may
- # not be what you would expect.
- #
- # Written by: David Gaxiola
- #
- # Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
- #
- # Change History:
- #
- # 1/17/97 AR Added comments
- # 8/19/92 DGG Made into parametric script and added more printing
- # comments.
- # 7/6/92 DGG Created
- #
- # To do:
- #
-
- Libraries "ControlPanels.vulib", "QuickTasks.vulib", "StandardDialogs.vulib",
- "UtilityTasks.vulib";
-
- script SimpleSample2Main()
- begin
- Using7 := RunningSystemSeven();
-
- MouseSpeed(10);
-
- TwitchApp();
-
- # Perform some simple manipulations on a few control panels.
- # Note that none of the control panels are automatically closed by the
- # CDEV tasks. The scripters has to do this themselves.
- if (Using7)
- begin
- LogNormal("Working on Monitors control panel: default operations");
- MonitorsCDEV();
- close [window t:"Monitors" o:1];
- LogNormal("Working on Sharing Setup control panel: default operations");
- SharingSetupCDEV();
- close [window t:"Sharing Setup" o:1];
- LogNormal("Working on Views control panel: Chicago 12, show nothing, always snap, meduim icon");
- ViewsCDEV("Chicago", "12", "shownothing", "alwayssnap", "medium");
- close [window t:"Views" o:1];
- LogNormal("Working on Monitors control panel: set to color");
- MonitorsCDEV("color");
- close [window t:"Monitors" o:1];
- LogNormal("Working on Views control panel: default operations");
- ViewsCDEV();
- close [window t:"Views" o:1];
- end;
-
- # Don't forget to make the settings specific to your setup!
- # You may use Chooser to select an appropriate driver.
- LogNormal("Running Page Setup operations.");
- PageSetup("LaserWriter", "USLegal", 60, "portrait");
- wait (10);
-
-
- # SimpleSample2 will try to find the Virtual User Agent on the target.
- if (Using7)
- begin
- LogNormal("Trying to find ∂'Agent VU∂'.");
- previousWindow := match [window o:1];
- select [menuItem t:/Find≈/ m:"File"];
- type k:{"Agent VU", enterKey};
-
- wait(1);
- thisWindow := match [window o:1];
- stillSearching := true;
- # A search may not find anything or it may take a long time. This is one way
- # of dealing with the different outcomes.
- while stillSearching
- begin
- if (thisWindow.s = dialog)
- stillSearching := false;
- else if (thisWindow.t = "Find")
- stillSearching := true;
- else if (thisWindow = previousWindow)
- stillSearching := true;
- else
- stillSearching := false;
- wait(1);
- thisWindow := match [window o:1];
- end;
-
- if (thisWindow.s = dialog)
- begin
- select [button t:"Ok" w:[window o:1]];
- LogError("Did you rename you VU Agent???");
- end;
- else if (previousWindow = thisWindow)
- LogNormal("It was already open!!!");
- else
- LogNormal("Agent VU found!");
- end; # if (Using7)
- end; # SimpleSample2